<?php

class Pipes_Value_BaseUrl
{
	private $_value;
	
	public function __construct() {
		$scheme = 'http';
		if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
			$scheme .= 's';
		}

		$baseUrl = $scheme . '://' . $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'];

		$this->_value = $baseUrl;
	}

	public function __get($key) {
		$return = null;
		if ($key == 'value') {
			$return = $this->_value;
		}

		return $return;
	}
}
